package controller.managedBeans;

import java.io.Serializable;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.*;
import javax.faces.context.FacesContext;

import model.dao.ItemsDao;
import model.entities.Item;

@ManagedBean(name = "itemsBean")
@ApplicationScoped
public class ItemsBacking   implements Serializable  {

	  private static final long serialVersionUID = 1L;
	  
		@EJB
	    private ItemsDao itemsFacade;
		
		private List<Item> items ;
		
		
		@PostConstruct
		public void init()
		{
			items = itemsFacade.findAll();
			System.out.println("application bean @PostConstruct items size=" + items.size());
		}


		public List<Item> getItems() {
			return items;
		}


		public void setItems(List<Item> items) {
			this.items = items;
		}
		
		
		
}
